home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / programming / other / gtlayout / source / ltp_searchkeys.c < prev    next >
C/C++ Source or Header  |  1999-04-19  |  998b  |  58 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1998 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. #include "Assert.h"
  15.  
  16. #ifdef DO_PICKSHORTCUTS    /* Support code */
  17.  
  18. VOID
  19. LTP_SearchKeys(LayoutHandle *handle,ObjectNode *group)
  20. {
  21.     ObjectNode    *node;
  22.     ULONG         page;
  23.  
  24.     SCANPAGE(group,node,page)
  25.     {
  26.         if(node->Type == GROUP_KIND)
  27.             LTP_SearchKeys(handle,node);
  28.         else
  29.         {
  30.             if(node->Key)
  31.             {
  32.                 LONG i;
  33.  
  34.                 for(i = 0 ; i < 256 ; i++)
  35.                 {
  36.                     if(LTP_Keys[0][i] == node->Key || LTP_Keys[1][i] == node->Key)
  37.                     {
  38.                         handle->Keys[LTP_Keys[0][i]] = TRUE;
  39.                         handle->Keys[LTP_Keys[1][i]] = TRUE;
  40.  
  41.                         break;
  42.                     }
  43.                 }
  44.  
  45.                 if(LTP_Keys[1][node->Key])
  46.                     node->Key = LTP_Keys[0][node->Key];
  47.             }
  48.             else
  49.             {
  50.                 if((handle->CursorKey == node) || (handle->ReturnKey == node) || (handle->EscKey == node) || (handle->TabKey == node))
  51.                     node->NoKey = TRUE;
  52.             }
  53.         }
  54.     }
  55. }
  56.  
  57. #endif    /* DO_PICKSHORTCUTS */
  58.